stm32mp1: sp_min: initialize MMU and cache earlier
authorYann Gautier <[email protected]>
Thu, 11 Jul 2019 08:45:09 +0000 (10:45 +0200)
committerYann Gautier <[email protected]>
Mon, 2 Sep 2019 15:52:34 +0000 (17:52 +0200)
This change enhances performance and security in BL32 stage.

Change-Id: I64df5995fc6b04f6cf42d6a00a6d3d0f602b5407
Signed-off-by: Yann Gautier <[email protected]>
plat/st/stm32mp1/sp_min/sp_min_setup.c

index 5ad219085bef90447b119d850e0de113fa3e2a7d..e54249f7441f7ddce8f7b284ae35c30034e68846 100644 (file)
@@ -89,6 +89,12 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
        /* Imprecise aborts can be masked in NonSecure */
        write_scr(read_scr() | SCR_AW_BIT);
 
+       mmap_add_region(BL_CODE_BASE, BL_CODE_BASE,
+                       BL_CODE_END - BL_CODE_BASE,
+                       MT_CODE | MT_SECURE);
+
+       configure_mmu();
+
        assert(params_from_bl2 != NULL);
        assert(params_from_bl2->h.type == PARAM_BL_PARAMS);
        assert(params_from_bl2->h.version >= VERSION_2);
@@ -136,12 +142,6 @@ void sp_min_early_platform_setup2(u_register_t arg0, u_register_t arg1,
  ******************************************************************************/
 void sp_min_platform_setup(void)
 {
-       mmap_add_region(BL_CODE_BASE, BL_CODE_BASE,
-                       BL_CODE_END - BL_CODE_BASE,
-                       MT_CODE | MT_SECURE);
-
-       configure_mmu();
-
        /* Initialize tzc400 after DDR initialization */
        stm32mp1_security_setup();